import request from '@/utils/request'

export function listOrg(data) {
  return request({
    url: '/iam/v1/domains',
    method: 'post',
    data
  })
}

export function getOrg(id) {
  return request({
    url: '/iam/v1/domain/' + id,
    method: 'get'
  })
}

export function createOrg(data) {
  return request({
    url: '/iam/v1/domain',
    method: 'post',
    data
  })
}

export function updateOrg(id, data) {
  return request({
    url: '/iam/v1/domain/' + id,
    method: 'put',
    data
  })
}

export function deleteOrg(id) {
  return request({
    url: '/iam/v1/domain/' + id,
    method: 'delete'
  })
}

export function listOrgUser(data) {
  return request({
    url: '/iam/v1/domain/users',
    method: 'post',
    data
  })
}

export function createUser(data) {
  return request({
    url: '/iam/v1/domain/user',
    method: 'post',
    data
  })
}

export function updateUser(id, data) {
  return request({
    url: '/iam/v1/domain/user/' + id,
    method: 'put',
    data
  })
}

export function deleteUser(id) {
  return request({
    url: '/iam/v1/domain/user/' + id,
    method: 'delete'
  })
}

export function getDam(id, data) {
  return request({
    url: '/dam/v1/instancex/' + id,
    method: 'post',
    data
  })
}
